<template>
  <!-- 返回首页 -->
  <div class="icon topLeft">
    <img src="@/assets/img/左箭头.svg" alt="" @click="$router.push('/home')" />
  </div>
  个人中心
  <div class="infoUserTop">
    <img :src="user.data.profile.avatarUrl" alt="" class="profileimg" />
    <div class="name">{{ user.data.profile.nickname }}</div>
  </div>
</template>
<script>
import { mapState } from 'vuex'
export default {
  computed: {
    ...mapState(['user']),
  },
  mounted() {
    console.log(this.user)
  },
}
</script>
<style lang="less" scoped>
.infoUserTop {
  width: 100%;
  height: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;

  // 图片
  .profileimg {
    width: 8rem;
    height: 8rem;
    border-radius: 50%;
    margin-top: 4.2rem;
  }
  .name {
    font-weight: 700;
    font-size: 0.4rem;
  }
}
</style>
